<%@ page import="java.util.Enumeration" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/6/5
  Time: 21:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    // 禁止IE浏览器访问
    String userAgent = request.getHeader("User-Agent");
    out.print(userAgent);
    if (userAgent != null && userAgent.contains("Trident")) {
        response.getWriter().println("Sorry, IE is not allowed to access this page.");
        response.setStatus(403);
        return;
    }
    // 输出所有的请求头
    Enumeration<String> headers = request.getHeaderNames();
    while (headers.hasMoreElements()) {
        String headerName = headers.nextElement();
        out.println(headerName + ": " + request.getHeader(headerName) + "<br>");
    }
%>
</body>
</html>
